<?php

namespace app\models;

use yii\db\ActiveRecord;

/**
 * 接口
 * Class Api
 * @package app\models
 *
 * @property integer $id PK
 * @property string $name 名称
 * @property string $param 参数列表JSON
 */
class CardHistory extends ActiveRecord
{
	
    /**
     * 关联接口
     * @return \yii\db\ActiveQuery
     */
    public function getApi()
    {
        return $this->hasOne(Api::class, ['id' => 'api_id']);
    }
    /**
     * 关联运营商
     * @return \yii\db\ActiveQuery
     */
    public function getIsp()
    {
        return $this->hasOne(Isp::class, ['id' => 'isp_id']);
    }
    /**
     * 关联套餐
     * @return \yii\db\ActiveQuery
     */
    public function getPackage()
    {
        return $this->hasOne(Package::class, ['id' => 'package_id']);
    }
    /**
     * 关联代理商
     * @return \yii\db\ActiveQuery
     */
    public function getAgent()
    {
        return $this->hasOne(Agent::class, ['id' => 'agent_id']);
    }

    /**
     * 关联用户
     * @return \yii\db\ActiveQuery
     */
    public function getUser()
    {
        return $this->hasOne(User::class, ['id' => 'uid']);
    }
}
